# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=libemf2svg
pkgver=1.1.0
pkgrel=2
pkgdesc="MS EMF (Enhanced Metafile) to SVG conversion library"
url="https://github.com/kakwa/libemf2svg"
arch="all"
license="GPL-2.0-only"
makedepends="cmake gnu-libiconv-dev libpng-dev fontconfig-dev freetype-dev
	argp-standalone"
subpackages="$pkgname-utils"
source="$pkgname-$pkgver.tar.gz::https://github.com/kakwa/libemf2svg/archive/$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	cmake . -DCMAKE_INSTALL_PREFIX=/usr/ -DEXTERNAL_ARGP=argp
	make
}

check() {
	cd "$builddir"
	# FIXME
	./emf2svg-conv -V
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

utils() {
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/emf2svg-conv "$subpkgdir"/usr/bin
}

sha512sums="1e9c1274cb7fc3552e7d91169b500ee9d3e1870e411059abc0b343b8b82382e42127b59023753336580f591437003ad0565b6653d661ce5008baa64ebb6f1bd8  libemf2svg-1.1.0.tar.gz"
